from django import forms
from models import Hotel
from django.forms import extras
from django.contrib.admin import widgets

class SearchHotel(forms.Form):
    hotel = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
    city = forms.ChoiceField(choices=[(e, e) for e in Hotel.objects.values_list('city', flat=True).distinct()],
                             required=True, widget=forms.Select(attrs={'class': 'selectpicker show-tick form-control'}),
                             label="City")
    region = forms.ChoiceField(choices=[(e, e) for e in Hotel.objects.values_list('region', flat=True).distinct()]
                               , required=True, widget=forms.Select(attrs={'class': 'selectpicker show-tick form-control'}),
                               label="Region")
    #checkin = forms.DateField(input_formats=['%Y-%m-%d'], widget=widgets.AdminDateWidget(), required=True,
    #                          label="check-in date")
    #checkout = forms.DateField(input_formats=['%Y-%m-%d'], widget=widgets.AdminDateWidget(), required=True,
    #                          label="check-out date")


    checkin = forms.DateField(input_formats=['%Y-%m-%d'], widget=extras.SelectDateWidget ,required=True,
                              label="check-in date")
    checkout = forms.DateField(input_formats=['%Y-%m-%d'], widget=extras.SelectDateWidget ,required=True,
                              label="check-out date")
